<?php

declare(strict_types=1);

namespace App\Request\Amount;

use Hyperf\Validation\Request\FormRequest;

class GroupTypeRequest extends FormRequest
{
    /**
     * Determine if the user is authorized to make this request.
     */
    public function authorize(): bool
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     */
    public function rules(): array
    {
        return [
            'end_date' => 'required|date',
            'start_date' => 'required|date',
            'account_id' => 'nullable',
        ];
    }


    public function messages(): array
    {
        return [
            'end_date.required' => '请选择结束日期',
            'start_date.required' => '请选择开始日期',
            'start_date.date' => '请选择正确的开始日期',
            'end_date.date' => '请选择正确的结束日期',
        ];
    }
}
